/*
 * @Author: yujianxia
 * @Date: 2021-06-16 13:41:37
 * @LastEditTime: 2021-06-16 15:23:24
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \base-framework-web\src\pages\features\account\personalCenter\components\SelfInfo.tsx
 */
import React, { useState, useEffect, useCallback } from 'react';
import { Upload, message, Button, Avatar } from 'antd';

import { UploadOutlined,UserOutlined } from '@ant-design/icons';
import styles from '../index.less';
const props = {
    name: 'file',
    action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
    headers: {
        authorization: 'authorization-text',
    },
    onChange(info:any) {
        if (info.file.status !== 'uploading') {
            console.log(info.file, info.fileList);
        }
        if (info.file.status === 'done') {
            message.success(`${info.file.name} file uploaded successfully`);
        } else if (info.file.status === 'error') {
            message.error(`${info.file.name} file upload failed.`);
        }
    },
};
const SelfInfo: React.FC = () => {
    return (
        <div className={styles.self_info}>
            <div>
                <Avatar
                    size={64}
                    src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png"
                />
                {/* 上传头像 */}
                <Upload {...props}>
                    <Button icon={<UploadOutlined />} size="small" style={{margin:"16px 0"}}>修改头像</Button>
                </Upload>
                <p className={styles.user_name}>Allen Iverson</p>
            </div>
        
            {/* 用户信息 */}
            <div className={styles.self_info_tips}>
                <p><UserOutlined/>客户编号：123456</p>
                <p><UserOutlined/>客户名称：艾利克斯</p>
                <p><UserOutlined/>公司全称：艾利克斯生物科技有限公司</p>
                <p style={{marginBottom:"30px"}}><UserOutlined/>当前状态：启用</p>
                <p><UserOutlined/>产品许可有效期：2021/03-2022/05</p>
                <p style={{marginBottom:"30px"}}><UserOutlined/>产品许可剩余天数：263天</p>
                <p><UserOutlined/>联系人：安妮</p>
                <p><UserOutlined/>联系电话：13900000000</p>
                <p><UserOutlined/>联系邮箱：annie@travelsky.com</p>
            </div>
        </div>
    );
};

export default SelfInfo;